package cn.tedu.spring.bean;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestUserDao {
    public static void main(String[] args) {
        /*
        1.创建Spring bean对象 -- IoC容器;
        2.获取Spring bean对象 -- getBean(类.class);
        3.使用Spring bean对象;
         */
        ApplicationContext context = new AnnotationConfigApplicationContext("cn.tedu.spring.bean");
        UserService userService = context.getBean(UserService.class);
        System.out.println("userService = " + userService);
    }
}









